package com.taoge.controller;

import com.taoge.annotation.LeakyBucketLimit;
import com.taoge.annotation.SlideWindowLimit;
import com.taoge.annotation.TimeStatisticsLimit;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试用例控制器
 * @author Mr.Tao
 */
@RestController
public class TestController {

    @LeakyBucketLimit(capacity = 3, leakRate = 2000)
    @GetMapping("/leaky")
    public String leaky() {
        return "leaky";
    }

    @TimeStatisticsLimit(time = 5, count = 2)
    @GetMapping("/time")
    public String time() {
        return "time";
    }

    @SlideWindowLimit(time = 3, count = 1)
    @GetMapping("/slide")
    public String slide() {
        return "slide";
    }

    @GetMapping("/normal")
    public String normal() {
        return "normal";
    }

}
